/**
Company: Sarkar software technologys
WebSite: http://www.sarkar.cn
Author: yeganaaa
Date : 5/16/18
Time: 2:10 PM
 */

package Cn.Sarkar.IMS.Entities

import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.Entities.IMS.*
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.IMS.DataBaseDefinations.BuyTrades
import java.util.*

class BuyTrade(DataContext: IDataContext) : IBuyTrade, BaseEntity(DataContext, BuyTrades) {
    var applicationDomainID by BuyTrades.ApplicationDomainID
    override var applicationDomain: IIMSApplicationDomain by hasOne(BuyTrades.ApplicationDomainID) { IMSApplicationDomain(it) }
    var weID by BuyTrades.WeID
    override var we: IOrgan by hasOne(BuyTrades.WeID) { Organ(it) }
    var theyID by BuyTrades.TheyID
    override var they: IOrgan by hasOne(BuyTrades.TheyID) { Organ(it) }
    override var products: Collection<IProduct> = LinkedList()
    var priceTableID by BuyTrades.PriceTableID
    override var price: IPriceTable by hasOne(BuyTrades.PriceTableID) { PriceTable(it) }
    override var state: Int by BuyTrades.State
    var areaID by BuyTrades.AreaID
    override var area: IArea by hasOne(BuyTrades.AreaID) { Area(it) }
    var orderID by BuyTrades.OrderID
    override var order: IOrder? = null
    override var tradeItems: Collection<ITradeItem> = LinkedList()
}